<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Iniuriam: /home/etu/v/p1115890/LIF7/EncoreUn/iniuriam/src/terrain.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Iniuriam
   &#160;<span id="projectnumber">alpha 1</span>
   </div>
   <div id="projectbrief"> RPG futuriste</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/etu/v/p1115890/LIF7/EncoreUn/iniuriam/src/terrain.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="terrain_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef TERRAIN_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define TERRAIN_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;SDL/SDL.h&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="tile_8h.html">tile.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="constante_8h.html">constante.h</a>&quot;</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 
<a name="l00017"></a><a class="code" href="structTerrain.html">00017</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00018"></a>00018 {
<a name="l00019"></a><a class="code" href="structTerrain.html#a179054bdece6848354d67748114c0d61">00019</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structTerrain.html#a179054bdece6848354d67748114c0d61">numCarte</a>;
<a name="l00020"></a><a class="code" href="structTerrain.html#a52e8d64449a598071d6a93cb794d4e01">00020</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structTerrain.html#a52e8d64449a598071d6a93cb794d4e01">nbrTileChipset</a>;        
<a name="l00021"></a><a class="code" href="structTerrain.html#acf54e12eec3dbd80ff928159f24a2a4f">00021</a>     <span class="keywordtype">int</span> <a class="code" href="structTerrain.html#acf54e12eec3dbd80ff928159f24a2a4f">decalageX</a>;      
<a name="l00022"></a><a class="code" href="structTerrain.html#ad242812fa3e76195a1d83ff20c1c28dc">00022</a>     <span class="keywordtype">int</span> <a class="code" href="structTerrain.html#ad242812fa3e76195a1d83ff20c1c28dc">defilY</a>;         
<a name="l00023"></a><a class="code" href="structTerrain.html#a330b75519be9012c58c9afe4917c5b44">00023</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structTerrain.html#a330b75519be9012c58c9afe4917c5b44">tileSel</a>;        
<a name="l00025"></a><a class="code" href="structTerrain.html#ad4e8a850a2df357acb59d6d576ec3dca">00025</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structTerrain.html#ad4e8a850a2df357acb59d6d576ec3dca">hauteurChipset</a>;   
<a name="l00026"></a><a class="code" href="structTerrain.html#a229881bb4b995a6f80e65e5d78a60262">00026</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structTerrain.html#a229881bb4b995a6f80e65e5d78a60262">largeurChipset</a>;   
<a name="l00027"></a><a class="code" href="structTerrain.html#a50dd312072446aaea81cc7e24ea683d8">00027</a>     <a class="code" href="structTile.html">Tile</a>* <a class="code" href="structTerrain.html#a50dd312072446aaea81cc7e24ea683d8">tabChipset</a>;       
<a name="l00028"></a><a class="code" href="structTerrain.html#af7ac4a423f572f548e518a826e738367">00028</a>     SDL_Surface* <a class="code" href="structTerrain.html#af7ac4a423f572f548e518a826e738367">chipset</a>;       
<a name="l00030"></a><a class="code" href="structTerrain.html#afebc03deafdd2d730dd7c8db9e43fccd">00030</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *<a class="code" href="structTerrain.html#afebc03deafdd2d730dd7c8db9e43fccd">carte</a>;       
<a name="l00031"></a>00031 } <a class="code" href="structTerrain.html">Terrain</a>;
<a name="l00032"></a>00032 
<a name="l00037"></a>00037 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a56ef2a9cde9c1acbe909a52386494efe" title="Preconditions : ter n&#39;a pas déjà été initialisé   Postconditions : ter est initialisé">terInit</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00038"></a>00038 
<a name="l00043"></a>00043 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#ac7c9d2364473068750c955841822d483" title="Preconditions : ter est initialisé   Postconditions : ter est remplis.">terRemplirStruct</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00044"></a>00044 
<a name="l00049"></a>00049 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a64d164a1f0beb73c20ecea7528a1c5d3" title="Preconditions : ter est initialisé   Postconditions : on change nbrTile.">setNbrTile</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nbrTile);
<a name="l00050"></a>00050 
<a name="l00055"></a>00055 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a5cc963e0209d7d0d4aa6941a20f8be97" title="Preconditions : ter est initialisé   Postconditions : on change decalageX.">setDecalageX</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">int</span> x);
<a name="l00056"></a>00056 
<a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#ad72e6e17ff549435edf028a8dac3e9f5" title="Preconditions : ter est initialisé   Postconditions : on change defilY.">setDefilY</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">int</span> y);
<a name="l00062"></a>00062 
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#abf6c41160daf296b8adcf853f2de98ae" title="Preconditions : ter est initialisé   Postconditions : on change tileSel.">setTileSel</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> selec);
<a name="l00068"></a>00068 
<a name="l00073"></a>00073 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#aa78a3024689d2e9a1814d32c53116655" title="Preconditions : ter est initialisé   Postconditions : on change hauteur.">setHauteur</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> hauteur);
<a name="l00074"></a>00074 
<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#af88ac718bc3e3b431765a2f7a9ab9403" title="Preconditions : ter est initialisé   Postconditions : on change largeur.">setLargeur</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> largeur);
<a name="l00080"></a>00080 
<a name="l00085"></a>00085 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a4eb64002ece4632d08080102eb59251c" title="Preconditions : ter est initialisé, 0 &lt;= i &lt;nbrTile   Postconditions : on change la ième case de tabC...">setTabChipset</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">int</span> i, <a class="code" href="structTile.html">Tile</a>* tile);
<a name="l00086"></a>00086 
<a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a16db0f7563d0f746c3ad954ef3f4754b" title="Preconditions : ter est initialisé, 0&lt;= i &lt; ter-&gt;hauteur*ter-&gt;largeur   Postconditions : on change la...">setCarte</a>(<a class="code" href="structTerrain.html">Terrain</a> *ter, <span class="keywordtype">int</span> i, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTile);
<a name="l00092"></a>00092 
<a name="l00097"></a>00097 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#aa84b30e0322d4d70abb2afbb858e076a" title="Preconditions : ter est initialisé, 0&lt;= i &lt; ter-&gt;hauteur*ter-&gt;largeur   Postconditions : on change le...">setNumCarte</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">char</span> i);
<a name="l00098"></a>00098 
<a name="l00103"></a>00103 <span class="keywordtype">char</span> <a class="code" href="terrain_8c.html#a13151e7f900c064bceadc6f00d0e81a1" title="Preconditions : ter est initialisé, 0&lt;= i &lt; ter-&gt;hauteur*ter-&gt;largeur   Postconditions : on recupere ...">getNumCarte</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00104"></a>00104 
<a name="l00109"></a>00109 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#affbee348130b49f5d0179c2d910f3d29" title="Preconditions : ter est initialisé   Postconditions : on récupère nbrTile.">getNbrTile</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00110"></a>00110 
<a name="l00115"></a>00115 <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#a74451f81a980b96ff24d4ee9fa93e2c3" title="Preconditions : ter est initialisé   Postconditions : on récupère decalageX.">getDecalageX</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00116"></a>00116 
<a name="l00121"></a>00121 <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#a0e77dbe7ae981a0041f50598025f1946" title="Preconditions : ter est initialisé   Postconditions : on récupère defilY.">getDefilY</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00122"></a>00122 
<a name="l00127"></a>00127 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#aef1ed673a4555bc3bce3009e2eda8778" title="Preconditions : ter est initialisé   Postconditions : on récupère tileSel.">getTileSel</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00128"></a>00128 
<a name="l00133"></a>00133 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#a6b95110758fd3ce3e16035ccfd4064b2" title="Preconditions : ter est initialisé   Postconditions : on récupère hauteur.">getHauteur</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00134"></a>00134 
<a name="l00139"></a>00139 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#adae65551a5eacfd5a811560849b95e5c" title="Preconditions : ter est initialisé   Postconditions : on récupère largeur.">getLargeur</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00140"></a>00140 
<a name="l00145"></a>00145 <a class="code" href="structTile.html">Tile</a>* <a class="code" href="terrain_8c.html#a6606e48fed6497746e1894e9d5d39471" title="Preconditions : ter est initialisé, 0 &lt;= i &lt;nbrTile   Postconditions : on récupère le ième case de ta...">getTabChipset</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">int</span> i);
<a name="l00146"></a>00146 
<a name="l00151"></a>00151 <span class="keywordtype">int</span> <a class="code" href="terrain_8c.html#ae6e653cd9e400541a92710a1e39fd67d" title="Preconditions : ter est initialisé, 0&lt;= i &lt; ter-&gt;hauteur*ter-&gt;largeur   Postconditions : on récupère ...">getCarte</a>(<a class="code" href="structTerrain.html">Terrain</a> *ter, <span class="keywordtype">int</span> i);
<a name="l00152"></a>00152 
<a name="l00157"></a>00157 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a94d8cda78cb565cee0d52ab54f4dcda3" title="Preconditions : ter est initialisé, nomChipset est le même que celui chargé dans remplirStructTerrain...">terSauvegarde</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">char</span>* nomChipset);
<a name="l00158"></a>00158 
<a name="l00163"></a>00163 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a3e7e9fbb1d028599836695cefa32ed49" title="Preconditions : ter est initialisé, nomFichier non null et existe   Postconditions : on charge le fih...">terCharger</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter, <span class="keywordtype">char</span>* nomFichier);
<a name="l00164"></a>00164 
<a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="terrain_8c.html#a37dbda9207e6024fb29ab1c8306aa6d4" title="Preconditions : ter est initialisé   Postconditions : on libère ter.">terLibere</a>(<a class="code" href="structTerrain.html">Terrain</a>* ter);
<a name="l00170"></a>00170 
<a name="l00171"></a>00171 <span class="preprocessor">#endif</span>
<a name="l00172"></a>00172 <span class="preprocessor"></span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Jun 4 2013 08:45:33 for Iniuriam by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
